package com.uni.crawl.service.crawl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseService;
import com.uni.crawl.common.enums.crawl.CrawlInstanceStatusEnum;
import com.uni.crawl.model.entity.crawl.CrawlInstance;
import com.uni.crawl.model.query.crawl.CrawlInstancePageQuery;
import com.uni.crawl.model.vo.crawl.CrawlInstanceVO;

import java.util.List;

/**
 * <p>
 * 爬虫实例 服务类
 * </p>
 *
 * @author JervisPG
 * @since 2023-12-16
 */
public interface CrawlInstanceService extends MPJBaseService<CrawlInstance> {

    List<CrawlInstance> list(CrawlInstanceStatusEnum statusEnum);

    Page<CrawlInstanceVO> getPage(CrawlInstancePageQuery pageQuery);

    void setInstanceStatus(Long id, CrawlInstanceStatusEnum statusEnum);

    void increaseTotal(Long id, int count);

    void increaseFinish(Long id, int count);

    void calculateStatus(Long id);
}
